<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="zh-CN">
<head>
	<%@include file="/resource/common/resourceLink.rs" %>
	<title>个人信息 - 支付宝</title>
    <script src="/Bank3.0/resource/js/checkForm.js"></script>
</head>
<style>
	.input-item{
		display: inline;
		width: auto;
	}
	.padding-five{
		padding: 5px 0;
	}
</style>
<body>
	<!-- 顶部导航 -->
	<%@ include file="nav.jsp" %>
	<div class="container-fluid">
		<div class="row" style="margin-top: 3%">
			<div class="col-md-offset-2 col-md-5">
				<p>修改个人信息</p>
				<p class="bg-danger" id="msg">${requestScope.msg}</p>
				<form action='<c:url value="/user/updateUserInformation/index.htm" />' method="post" onsubmit="return doCheck()">
					<div class="padding-five">
						<label>昵 称：</label>
						<input class="form-control input-item" type="text" name="userName" value="${sessionScope.user.userName}" />
						<label>${errors.userName}</label>
					</div>
					<div class="padding-five">
						<label>密 码：</label>
						<input class="form-control input-item" id="payPassword" type="password" name="password"
							   value="${sessionScope.user.password}" />
						<label>${errors.password}</label>
					</div>
					<div class="padding-five">
						<label>年 龄：</label>
						<input class="form-control input-item" type="number" name="age" value="${sessionScope.user.age}" />
						<label>${errors.age}</label>
					</div>
					<div class="padding-five">
						<label>性 别：</label>
						<input class="form-control input-item" type="text" name="sex" value="${sessionScope.user.sex}" />
						<label>${errors.sex}</label>
					</div>
					<div class="padding-five">
						<button class="btn btn-primary" style="margin-left: 7%" type="submit">确认修改</button>
					</div>
				</form>
			</div>
		</div>
	</div>


</body>
<script type="text/javascript">
    function doCheck() {
        var flag = false;
        var userName = document.getElementById("userName").value;
        var password = document.getElementById("payPassword").value;
        var confirmPassword = document.getElementById("payPassword").value;
        if (userName == ""){
            alert('请输入用户名');
        } else if (password == ""){
            alert('请输入密码');
		} else if(confirmPassword!=password){
            alert('前后密码');
		} else {
            flag = true;
		}
        return flag;
    }
</script>
</html>